package hu.tortavar2.client.view.product;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.HeadElement;
import com.google.gwt.dom.client.HeadingElement;
import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.UIObject;

public class ProductItemSimpleView extends UIObject {

	private static ProductItemSimpleViewUiBinder uiBinder = GWT
			.create(ProductItemSimpleViewUiBinder.class);
	
	interface ProductItemSimpleViewUiBinder extends
			UiBinder<Element, ProductItemSimpleView> {
	}

	String id;
	@UiField DivElement ribbon;
	@UiField ImageElement image;
	@UiField HeadingElement title;
	@UiField SpanElement price;
	@UiField SpanElement available;

	public ProductItemSimpleView() {
		setElement(uiBinder.createAndBindUi(this));
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setRibbonType(String ribbonType) {
		this.ribbon.addClassName(ribbonType);
	}
	
	public void setImageUrl(String url) {
		this.image.setAttribute("scr", url);
	}
	
	public void setProductTitle(String title) {
		this.title.setInnerText(title);
	}
	
	public void setPrice(String price) {
		this.price.setInnerText(price);
	}
	
	public void setAvailable(String available) {
		this.available.setInnerText(available);
	}
}
